package com.example.mywebview;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.just.agentweb.AgentWeb;

public class MainActivity extends AppCompatActivity {
    public static final String ASSETSFILE = "file:///android_asset/";
    private LinearLayout mLinearLayout;
    private AgentWeb mAgentWeb;
    private WebView mWebView;
    private ImageView mImageView;
    private ImageView mImageView1;
    private TextView mTextView;
    private TextView mTextView1;
    private Handler handler;
    private TextView mTextView2;
    private TextView mTextView3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mTextView2 = new TextView(this);
        mTextView3 = new TextView(this);


        new Thread(new Runnable() {
            @Override
            public void run() {
                Thread thread = Thread.currentThread();
                Message message = new Message();
            }
        }).start();
    }

    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (mAgentWeb.handleKeyEvent(keyCode, event)) {
            return true;
        }
        return super.onKeyUp(keyCode, event);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mAgentWeb.getWebLifeCycle().onResume();
    }


    @Override
    protected void onPause() {
        super.onPause();
        mAgentWeb.getWebLifeCycle().onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mAgentWeb.getWebLifeCycle().onDestroy();
    }

    public void wang(int a, int b) {

    }
}